<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hubert</title>
    <description>blog </description>
    <link>https://hubert932.github.io//</link>
    <atom:link href="https://hubert932.github.io//feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 10 Sep 2018 01:17:24 +0000</pubDate>
    <lastBuildDate>Mon, 10 Sep 2018 01:17:24 +0000</lastBuildDate>
    <generator>Jekyll v3.7.4</generator>
    
      <item>
        <title>Kaggle Mercari</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#mercari-price-suggestion-challenge&quot; id=&quot;markdown-toc-mercari-price-suggestion-challenge&quot;&gt;Mercari Price Suggestion Challenge&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#python&quot; id=&quot;markdown-toc-python&quot;&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;mercari-price-suggestion-challenge&quot;&gt;Mercari Price Suggestion Challenge&lt;/h2&gt;

&lt;h2 id=&quot;python&quot;&gt;Python&lt;/h2&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;g = lambda x:x+1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
lambda作为一个表达式，定义了一个匿名函数，上例的代码x为入口参数，x+1为函数体，用函数来表示为：

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;def g(x):
    return x+1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Mon, 10 Sep 2018 10:04:05 +0000</pubDate>
        <link>https://hubert932.github.io//2018/09/10/kaggle/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2018/09/10/kaggle/</guid>
        
        <category>Kaggle</category>
        
        <category>Python</category>
        
        
        <category>Kaggle</category>
        
      </item>
    
      <item>
        <title>Ubuntu 分辨率更改</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#问题&quot; id=&quot;markdown-toc-问题&quot;&gt;问题&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#xorgconf&quot; id=&quot;markdown-toc-xorgconf&quot;&gt;xorg.conf&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;问题&quot;&gt;问题&lt;/h2&gt;

安装了Ubuntu后分辨率和显示器不匹配

xrandr Failed to get size of gamma for output default

&lt;h2 id=&quot;xorgconf&quot;&gt;xorg.conf&lt;/h2&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo vim /etc/xorg.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
复制以下内容：

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Section &quot;Monitor&quot;
        Identifier   &quot;Monitor0&quot;
        VendorName   &quot;Monitor Vendor&quot;
        ModelName    &quot;Monitor Model&quot;
        HorizSync   28.0 - 70.0
        VertRefresh     56.0 - 75.0
EndSection
 
 
Section &quot;Device&quot;
        Identifier  &quot;VMware SVGA&quot;
        Driver      &quot;vesa&quot;
EndSection
 
 
Section &quot;Screen&quot;
        Identifier &quot;Screen0&quot;
        Device     &quot;Card0&quot;
        Monitor    &quot;Monitor0&quot;
        SubSection &quot;Display&quot;
                Viewport   0 0
                Depth     24
                Modes     &quot;1920x1080_60.00&quot;
        EndSubSection
EndSection
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

:wq!（保存

重新启动就成功了。
</description>
        <pubDate>Thu, 06 Sep 2018 16:42:05 +0000</pubDate>
        <link>https://hubert932.github.io//2018/09/06/ubuntu/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2018/09/06/ubuntu/</guid>
        
        <category>Ubuntu</category>
        
        <category>xrandr</category>
        
        
        <category>Ubuntu</category>
        
      </item>
    
      <item>
        <title>Algorithm part1 Order-of-Growth</title>
        <description>
#Binary Search
Too big, go left
Too small, go right
Equal, found

find 8

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mid     mid 1 3 5 6 8 9 13 15 18 23 26 28
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;public static int binarySearch(int a[], int key)
{
  int lo = 0, hi = a.length-1;
  while(lo &amp;lt;= hi)
  {
   int mid = lo+(hi-lo)/2;
   if      (key&amp;lt;a[mid]) hi = mid-1;
   else if (key&amp;gt;a[mid]) lo = mid+1;
   else return mid;
  }
  return -1;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Wed, 05 Sep 2018 21:19:05 +0000</pubDate>
        <link>https://hubert932.github.io//2018/09/05/Algorithm/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2018/09/05/Algorithm/</guid>
        
        <category>Algorithm</category>
        
        <category>binary</category>
        
        <category>search</category>
        
        
        <category>Algorithm</category>
        
      </item>
    
      <item>
        <title>Algorithm part1 Mathmatical Model</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#思路&quot; id=&quot;markdown-toc-思路&quot;&gt;思路&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

How many array accesses does the following code fragment make as a function of nn?
(Assume the compiler does not optimize away any array accesses in the innermost loop.)

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;int sum = 0;
for (int i = 0; i &amp;lt; n; i++)
    for (int j = i+1; j &amp;lt; n; j++)
        for (int k = 1; k &amp;lt; n; k = k*2)
            if (a[i] + a[j] &amp;gt;= a[k]) sum++;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

∼3n^2     &lt;font color=&quot;red&quot;&gt;~3n^2lgn/2&lt;/font&gt;    ~3n^3/2     ~3n^3

&lt;h2 id=&quot;思路&quot;&gt;思路&lt;/h2&gt;

Not all triple loops have cubic running times. For a given value of ii and jj, the kk-loop 
requires only 3lgn array access: the body is executed lgn times and each time involves 3 array 
accesses. As in the 2-SUM and 3-SUM analysis, the number of times the k-loop is executed is 
nC2 ~ n^2/2
</description>
        <pubDate>Wed, 05 Sep 2018 20:57:05 +0000</pubDate>
        <link>https://hubert932.github.io//2018/09/05/algorithm/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2018/09/05/algorithm/</guid>
        
        <category>Algorithm</category>
        
        <category>exercises</category>
        
        
        <category>Algorithm</category>
        
      </item>
    
      <item>
        <title>leetcode78解题思路</title>
        <description>
本文为leetcode刷题笔记。

</description>
        <pubDate>Tue, 04 Sep 2018 20:57:05 +0000</pubDate>
        <link>https://hubert932.github.io//2018/09/04/leetcode78/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2018/09/04/leetcode78/</guid>
        
        <category>Leetcode</category>
        
        <category>二叉树</category>
        
        
        <category>Leetcode</category>
        
      </item>
    
      <item>
        <title>第一条博客</title>
        <description>
在网上搜了博客的网站，最后还是决定看教程，用github搭一个静态博客，现在是第一条测试博客。
</description>
        <pubDate>Tue, 04 Sep 2018 20:49:54 +0000</pubDate>
        <link>https://hubert932.github.io//2018/09/04/first-blog/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2018/09/04/first-blog/</guid>
        
        <category>fiirst</category>
        
        
        <category>first</category>
        
      </item>
    
      <item>
        <title>提升用户体验的前端动画</title>
        <description>
与其他开发人员不同的是，前端开发都是在端上游走舞者，直接与用户交流沟通，这就需要前端开发具有更敏锐的交互体验思考，或者能更精准地理解设计师们意图，将最佳的用户体验带给用户。优质的交互体验对于用户来说学习成本应该是极低的，都是非常自然的操作，却可以让用户感到畅快愉悦，甚至惊喜。本文将通过一个看似简单的 poplayer 来分析我在这其中通过思考做的体验优化，获得类似 native 的体验感。

&lt;img src=&quot;https://ws1.sinaimg.cn/large/7011d6cfgy1frx9jv0kpfj208w0fracu.jpg&quot; alt=&quot;&quot; /&gt;

</description>
        <pubDate>Fri, 01 Jun 2018 00:00:00 +0000</pubDate>
        <link>https://hubert932.github.io//2018/06/01/animation/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2018/06/01/animation/</guid>
        
        <category>动画</category>
        
        <category>手势</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>前端如何写一个精确的倒计时</title>
        <description>
关于写倒计时大家可能都都比较熟悉，使用 setTimeout 或 setInterval 就可以搞定。几秒钟或者几分钟的倒计时这样写没有问题，但是如果是长时间的倒计时，这样写就会不准确。如果用户修改了他的设备时间，这样的倒计时就没有意义了。今天就说说写一个精确的倒计时的方法。

&lt;img src=&quot;https://img.alicdn.com/tfs/TB18QnlOpXXXXcVXpXXXXXXXXXX-388-256.png&quot; alt=&quot;&quot; /&gt;

</description>
        <pubDate>Fri, 25 Nov 2016 00:00:00 +0000</pubDate>
        <link>https://hubert932.github.io//2016/11/25/how-to-write-a-count-down/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2016/11/25/how-to-write-a-count-down/</guid>
        
        <category>countdown</category>
        
        <category>JavaScript</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>使用 JavaScript 创建并下载文件</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#先上代码&quot; id=&quot;markdown-toc-先上代码&quot;&gt;先上代码&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

本文将介绍如何使用 JavaScript 创建文件，并自动/手动将文件下载。这在导出原始数据时会比较方便。

&lt;h2 id=&quot;先上代码&quot;&gt;先上代码&lt;/h2&gt;

&lt;div class=&quot;language-js highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/**
 * 创建并下载文件
 * @param  {String} fileName 文件名
 * @param  {String} content  文件内容
 */&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;createAndDownloadFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fileName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;blob&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Blob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;download&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;fileName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createObjectURL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;blob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;revokeObjectURL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;blob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

很简单对吧，直接调用这个方法，传入文件名和文件内容，程序新建 a 标签，新建 Blob 对象，将文件名赋给 a 标签，同时将 Blob 对象作为 Url 也赋给 a 标签，模拟点击事件，自动下载成功，最后再回收内存。下面我们来看看具体是怎么操作的。

</description>
        <pubDate>Tue, 22 Nov 2016 00:00:00 +0000</pubDate>
        <link>https://hubert932.github.io//2016/11/22/js-create-file-and-download/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2016/11/22/js-create-file-and-download/</guid>
        
        <category>文件</category>
        
        <category>下载</category>
        
        <category>JavaScript</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>Fisher–Yates shuffle 洗牌算法</title>
        <description>
简单来说 Fisher–Yates shuffle 算法是一个用来将一个有限集合生成一个随机排列的算法（数组随机排序）。这个算法生成的随机排列是等概率的。同时这个算法非常高效。

本文主要介绍这个算法的来源、演变、原理。并举出一个例子为大家清晰的描述每次迭代过程。最后使用 JavaScript 代码将算法实现。

&lt;img src=&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Riffle_shuffle.jpg/320px-Riffle_shuffle.jpg&quot; alt=&quot;&quot; /&gt;

</description>
        <pubDate>Sun, 16 Oct 2016 00:00:00 +0000</pubDate>
        <link>https://hubert932.github.io//2016/10/16/shuffle-algorithm/</link>
        <guid isPermaLink="true">https://hubert932.github.io//2016/10/16/shuffle-algorithm/</guid>
        
        <category>算法</category>
        
        <category>shuffle</category>
        
        <category>乱序</category>
        
        <category>洗牌</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
  </channel>
</rss>
